#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2020/8/5 3:34 下午
# @Author  : wancheng.b
# @File    : python_test.py
# @Software: PyCharm
import requests
from requests import session

session = requests.session()

data = {
    'userName': 'jiaoshuo',
    'referrerUrl': 'http://test-admin.51tonglu.com/login',
    'credentials': 'jiaoshuo2018'
}
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}


# 可以理解成路由
response = session.post(url='http://test.upm.shebao.net/login.json', data=data, headers=headers)
print(response.text)

query = session.get('http://test-admin.51tonglu.com/api/companies?page=1&pageSize=10&keyword=%E9%9B%86%E7%BB%9F%E6%9C%88%E4%BB%98%E8%BE%B9')
print(query.text)
